package com.xinqi.modules.sys.stats.manager.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.xinqi.common.mybatis.data.service.impl.BaseServiceImpl;
import com.xinqi.modules.sys.stats.domain.HomePageDayStEntity;
import com.xinqi.modules.sys.stats.manager.HomePageDayStManager;
import com.xinqi.modules.sys.stats.mapper.HomePageDayStMapper;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

import java.time.LocalDate;
import java.time.LocalDateTime;

/**
 * 首页每天数据统计管理层实现
 *
 * @author: linkai
 * @date: 2023/04/25
 */
@Service
@RequiredArgsConstructor
public class HomePageDayStManagerImpl extends BaseServiceImpl<HomePageDayStMapper, HomePageDayStEntity> implements HomePageDayStManager {

    @Override
    public HomePageDayStEntity findByStatsDate(LocalDate statsDate) {
        LambdaQueryWrapper<HomePageDayStEntity> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(HomePageDayStEntity::getStatsDate, statsDate);
        return getOne(wrapper);
    }

    @Override
    public Integer findAddedUserNum(LocalDateTime startTime, LocalDateTime endTime) {
        return this.baseMapper.findAddedUserNum(startTime, endTime);
    }

    @Override
    public Integer findLoggedUserTotal() {
        return this.baseMapper.findLoggedUserTotal();
    }

    @Override
    public Integer findUserTotal() {
        return this.baseMapper.findUserTotal();
    }

    @Override
    public Integer findAddedCourseNum(LocalDateTime startTime, LocalDateTime endTime) {
        return this.baseMapper.findAddedCourseNum(startTime, endTime);
    }

    @Override
    public Integer findCourseTotal() {
        return this.baseMapper.findCourseTotal();
    }

    @Override
    public Integer findAddedClassNum(LocalDateTime startTime, LocalDateTime endTime) {
        return this.baseMapper.findAddedClassNum(startTime, endTime);
    }

    @Override
    public Integer findClassTotal() {
        return this.baseMapper.findClassTotal();
    }

    @Override
    public Integer findCourseAttendance(LocalDateTime startTime, LocalDateTime endTime) {
        return this.baseMapper.findCourseAttendance(startTime, endTime);
    }

    @Override
    public Integer findCourseNotice(LocalDateTime startTime, LocalDateTime endTime) {
        return this.baseMapper.findCourseNotice(startTime, endTime);
    }

    @Override
    public Integer findCourseDiscuss(LocalDateTime startTime, LocalDateTime endTime) {
        return this.baseMapper.findCourseDiscuss(startTime, endTime);
    }

    @Override
    public Integer findCourseExam(LocalDateTime startTime, LocalDateTime endTime) {
        return this.baseMapper.findCourseExam(startTime, endTime);
    }

    @Override
    public Integer findCourseHomework(LocalDateTime startTime, LocalDateTime endTime) {
        return this.baseMapper.findCourseHomework(startTime, endTime);
    }

}
